import { Pipe, PipeTransform } from '@angular/core';
import * as moment from 'moment';

@Pipe({
  name: 'objectidToTime',
})
export class ObjectidToTimePipe implements PipeTransform {
  transform(value: string, ...args: unknown[]): string {
    return moment(parseInt(value.toString().substring(0, 8), 16) * 1000).format(
      'YYYY-MM-DD HH:mm:ss',
    );
  }
}
